package com.spring.hed.factory.simple;

public class OperationFactory {

    public static Operation createOperate(String type){
        Operation operation = null;

        if (type.equals("+")){
            operation = new Add();
        }
        if (type.equals("-")){
            operation = new Sub();
        }
        if (type.equals("*")){
            operation = new Mul();
        }
        if (type.equals("/")){
            operation = new Div();
        }

        return operation;
    }

}
